package com.gec.hawaste.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gec.hawaste.entity.Examine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gec.hawaste.vo.ExamineDo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author chenxys
 * @since 2022-07-01
 */
public interface ExamineMapper extends BaseMapper<Examine> {
    /**
     * 考核查询 查询  examine - 考核表 sys_user - 用户表 sys_office - 公司(企业)
     * @author chenxys
     * @param page 分页查询
     * @param ew    查询条件
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.gec.hawaste.vo.ExamineDo>
     */
    @Select("select examine.*, " +
            "       sys_user.`name` user_name, " +
            "       sys_office.`name` office_name " +
            " from " +
            "examine, " +
            "sys_user," +
            "sys_office ${ew.customSqlSegment}")
    IPage<ExamineDo> selectByCondition(IPage<ExamineDo> page,
                                       @Param("ew") Wrapper ew);
}
